<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<HitchHikersGuideToTheGalaxy.Models.Tour>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Index
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Index</h2>

    <table>
        <tr>
            <th></th>
            <th>
                IsValid
            </th>
            <th>
                Id
            </th>
            <th>
                DestinationIdTo
            </th>
            <th>
                DestinationIdFrom
            </th>
            <th>
                Time
            </th>
            <th>
                VehicleDriverId
            </th>
            <th>
                SmokingAllowed
            </th>
            <th>
                PetAllowed
            </th>
            <th>
                AvailableSeats
            </th>
            <th>
                Distance
            </th>
            <th>
                Cost
            </th>
            <th>
                ModifiedTime
            </th>
            <th>
                CreatedTime
            </th>
            <th>
                Route
            </th>
            <th>
                Note
            </th>
        </tr>

    <% foreach (var item in Model) { %>
    
        <tr>
            <td>
                <%= Html.ActionLink("Edit", "Edit", new { id=item.Id }) %> |
                <%= Html.ActionLink("Details", "Details", new { id=item.Id })%>
            </td>
            <td>
                <%= Html.Encode(item.IsValid) %>
            </td>
            <td>
                <%= Html.Encode(item.Id) %>
            </td>
            <td>
                <%= Html.Encode(item.DestinationIdTo) %>
            </td>
            <td>
                <%= Html.Encode(item.DestinationIdFrom) %>
            </td>
            <td>
                <%= Html.Encode(String.Format("{0:g}", item.Time)) %>
            </td>
            <td>
                <%= Html.Encode(item.VehicleDriverId) %>
            </td>
            <td>
                <%= Html.Encode(item.SmokingAllowed) %>
            </td>
            <td>
                <%= Html.Encode(item.PetAllowed) %>
            </td>
            <td>
                <%= Html.Encode(item.AvailableSeats) %>
            </td>
            <td>
                <%= Html.Encode(String.Format("{0:F}", item.Distance)) %>
            </td>
            <td>
                <%= Html.Encode(String.Format("{0:F}", item.Cost)) %>
            </td>
            <td>
                <%= Html.Encode(String.Format("{0:g}", item.ModifiedTime)) %>
            </td>
            <td>
                <%= Html.Encode(String.Format("{0:g}", item.CreatedTime)) %>
            </td>
            <td>
                <%= Html.Encode(item.Route) %>
            </td>
            <td>
                <%= Html.Encode(item.Note) %>
            </td>
        </tr>
    
    <% } %>

    </table>

    <p>
        <%= Html.ActionLink("Create New", "Create") %>
    </p>

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="MainContent2" runat="server">
    <% Html.RenderPartial("UpcomingToursPartial", ViewData["UpcomingTours"]); %>
</asp:Content>

